﻿using System;
using System.Collections.Generic;
using System.Text;
using TntOrm;
using TntOrm.Attributes;

namespace SiteObjects
{
    [OrmTable( "WEB_PostPhoto", "Фотографии", false )]
    public class PostPhoto : OrmDataBaseObject
    {
        private int? id_PostPhoto;

        [OrmTableField( "id_PostPhoto", System.Data.SqlDbType.Int, false )]
        [OrmPrimaryKey]
        public int? PostPhotoID
        {
            get { return id_PostPhoto; }
            set { id_PostPhoto = value; }
        }
/*
        private Post _ToPost;
        
        [OrmTableField( "id_Post", System.Data.SqlDbType.Int, false )]
        [OrmReference( typeof( Post ), "PostID", BelongType.HasOne )]
        public Post ToPost
        {
            get { return _ToPost; }
            set { _ToPost = value; }
        }

        private Photo _ToPhoto;

        [OrmTableField( "id_Photo", System.Data.SqlDbType.Int, false )]
        [OrmReference( typeof( Post ), "PhotoID", BelongType.HasOne )]
        public Photo ToPhoto
        {
            get { return _ToPhoto; }
            set { _ToPhoto = value; }
        }
*/        
        private int? id_Post;

        [OrmTableField( "id_Post", System.Data.SqlDbType.Int, false )]
        [OrmReference( typeof( Post ), "PostID", BelongType.HasOne )]
        public int? PostID
        {
            get { return id_Post; }
            set { id_Post = value; }
        }

        private int? id_Photo;
        
        [OrmTableField( "id_Photo", System.Data.SqlDbType.Int, false )]
        [OrmReference( typeof( Post ), "PhotoID", BelongType.HasOne )]
        public int? PhotoID
        {
            get { return id_Photo; }
            set { id_Photo = value; }
        }
         
    }
}